import 'package:flutter/material.dart';

//PicturePage 图片页面
class PicturePage extends StatefulWidget {
  final String url;
  final double width;
  final double height;

  const PicturePage({
    super.key,
    required this.url,
    this.width = double.infinity,
    this.height = 200,
  });

  @override
  State<PicturePage> createState() => _PicturePageState();
}

class _PicturePageState extends State<PicturePage>
    with AutomaticKeepAliveClientMixin {
  @override
  Widget build(BuildContext context) {
    super.build(context);
    print(widget.url);
    return SizedBox(
      width: widget.width,
      height: widget.height,
      child: Image.asset(widget.url, fit: BoxFit.cover),
    );
  }

  @override
  bool get wantKeepAlive => true;
}
